package com.hgl.utils;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.alibaba.fastjson.JSON;
public abstract class LoggerSupport {

	protected Logger log=LoggerFactory.getLogger(this.getClass());
	protected String json(Object obj){
		if(obj==null){
			return null;
		}else if(obj instanceof String){
			return (String)obj;
		}else{
			return obj.getClass().getName()+" data out : \n"+JSON.toJSONString(obj,true);
		}
	}
	protected String format(String format,Object...args){
		return String.format(format, args);
	}
	protected void out(Object obj){
		log.debug(json(obj));
	}
}
